#ifndef __BSP_W5500_H
#define __BSP_W5500_H
#include "userConfig.h"
#include "rtthread.h"





#define W5500_CS(x)      do{ x ? \
                                gpio_bit_write(GPIOC, GPIO_PIN_4, SET) : \
                                gpio_bit_write(GPIOC, GPIO_PIN_4, RESET); \
                            }while(0)  

#define W5500_RESET(x)      do{ x ? \
                                gpio_bit_write(GPIOE, GPIO_PIN_3, SET) : \
                                gpio_bit_write(GPIOE, GPIO_PIN_3, RESET); \
                            }while(0) 

static void w5500_spi3_init(void);
static void w5500_control_init(void);
static uint8_t spi3_read_write_byte(uint8_t txdata);

static void SPI_CrisEnter(void);
static void SPI_CrisExit(void);

static void SPI_CS_Select(void);
static void SPI_CS_Deselect(void);

static uint8_t SPI_ReadByte(void);
static void SPI_WriteByte(uint8_t wb);

void w5500_init(void);
void w5500_RegisterFunction(void);
void spi3_set_speed(uint8_t speed);

















#endif


